< previous page page_503 next page >

Page 503
e10a6a0a59f035e870d90cca05b85fce.gif
' Create polylines to represent the surface.
Public Sub InitializeGrid( _
    ByVal gap_x As Single, ByVal gap_z As Single, _
    ByVal d_x As Single, ByVal d_z As Single)
Dim u As Single
Dim v As Single
Dim X As Single
Dim Y As Single
Dim Z As Single
Dim x1 As Single
Dim y1 As Single
Dim z1 As Single
Dim pline As Polyline3d

    GapU = gap_x
    GapV = gap_z
    Du = d_x
    Dv = d_z

    Set Polylines = New Collection

    ' Create curves with constant u.
    For u = 0 To 1 + GapU / 10 Step GapU
        Set pline = New Polyline3d
        Polylines.Add pline

        SurfaceValue u, 0, x1, y1, z1

        For v = Dv To 1 + Dv / 10 Step Dv
            SurfaceValue u, v, X, Y, Z
            pline.AddSegment x1, y1, z1, X, Y, Z
            x1 = X
            y1 = Y
            z1 = Z
        Next v
    Next u

    ' Create curves with constant v.
    For v = 0 To 1 + GapV / 10 Step GapV
        Set pline = New Polyline3d
        Polylines.Add pline

        SurfaceValue 0, v, x1, y1, z1
        For u = Du To 1 + Du / 10 Step Du
            SurfaceValue u, v, X, Y, Z
            pline.AddSegment x1, y1, z1, X, Y, Z
            x1 = X
            y1 = Y
            z1 = Z
        Next u
    Next v
End Sub

 
< previous page page_503 next page >